<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title>录入请假旷工情况</title>
<link rel="stylesheet" href="../public/layui/css/layui.css" media="all">
<script src="../public/layui/layui.js" charset="utf-8"></script>

</head>
<body>
<div>
	<fieldset class="layui-elem-field layui-field-title" style="margin-top: 30px;">
		<legend><h2>正在录入${param.operater }的请假旷工情况</h2></legend>
	</fieldset>
	<form action="" method="post" class="layui-form">
		<div class="layui-form-item">
	        <div class="layui-input-block">
	            <input type="text" id="leavecount" name="leavecount" lay-verify="required" lay-reqtext="如果您的意思是 0 次的话，也请填写个数字“0”" placeholder="请假次数" class="layui-input" style="width:500px;" />
	            <span id="span1"></span>
	        </div>
	    </div>
	    <div class="layui-form-item">
	        <div class="layui-input-block">
	            <input type="text" id="absentcount" name="absentcount" lay-verify="required" lay-reqtext="如果您的意思是 0 次的话，也请填写个数字“0”" placeholder="旷工次数" class="layui-input" style="width:500px;" />
	            <span id="span1"></span>
	        </div>
	    </div>
	    <div class="layui-form-item">
	        <div class="layui-input-block">
	        	<textarea id="applydescribe" name="applydescribe"  placeholder="相关描述" style="width:700px;" class="layui-textarea"></textarea>
	        </div>
	    </div>
	    <div class="layui-form-item">
	        <div class="layui-input-block">
	            <button type="submit" id="submit" name="submit" lay-submit="" lay-filter="submit1" class="layui-btn layui-btn-primary layui-border-green" >提交待审核</button>
	        </div>
	    </div>
	</form>
</div>

<script>
layui.use(['form','layer', 'jquery'],function(){
	$ = layui.jquery;
	var form = layui.form;
	var layer = layui.layer;
	
	form.on('submit(submit1)', function(data){
		var leavecount = document.getElementById("leavecount").value
		var absentcount = document.getElementById("absentcount").value
		var applydescribe = document.getElementById("applydescribe").value
		$.ajax({
			 url:"../ManagerServlet?button=2&operater=${param.operater }&leavecount="+leavecount+"&absentcount="+absentcount+"&applydescribe="+applydescribe
			 ,type:"post"
			 ,async:false
			 ,data: {}
			 ,success:function(res){
				 parent.layer.msg(res);
			 }
			,error:function(res){
				parent.layer.msg("系统异常");
			 }
		 });
//		alert("在在在");
		var index = parent.layer.getFrameIndex(window.name);
		parent.layer.close(index);
// 		return false; //阻止表单跳转。如果需要表单跳转，去掉这段即可。
	});
})

</script> 
</body>
</html>